package org.lmind.example.common.web.spring;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.lmind.example.common.core.PropertiesMap;
import org.lmind.example.common.web.ApplicationContext;
import org.lmind.example.common.web.SessionContext;

public class ExtraViewModel {
	
	private ApplicationContext applicationContext;

	private SessionContext sessionContext;
	
	private HttpServletRequest request;
	
	private PropertiesMap env;
	
	private PropertiesMap attributes;

	public ExtraViewModel(ApplicationContext applicationContext, 
			SessionContext sessionContext, HttpServletRequest request) {
		this.applicationContext = applicationContext;
		this.sessionContext = sessionContext;
		this.request = request;
		attributes = new PropertiesMap(sessionContext.getAttributes());
		env = new PropertiesMap(applicationContext);
		//request.get
	}

	public PropertiesMap getEnv() {
		return env;
	}

	public Object getUser() {
		return sessionContext.getCertificate();
	}

	public Object getModel() {
		return sessionContext.getModel();
	}
	
	public String getContextPath() {
		return sessionContext.getContextPath();
	}
	
	public String getRequestURI() {
		return sessionContext.getRequestURI();
	}

	public Map<String, Object> getAttributes() {
		return attributes;
	}

}
